package com.young.monitor.service.impl;

import com.young.interfaces.log.model.ApiMonitorDTO;
import com.young.interfaces.log.model.LogDTO;
import com.young.interfaces.monitor.service.IMonitorOutService;
import com.young.monitor.service.ILogCollectService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 监控中心对外服务
 * Created by Admin on 2021/6/20.
 */
@Service
public class MonitorOutServiceImpl implements IMonitorOutService {

    private static final Logger logger = LoggerFactory.getLogger(MonitorOutServiceImpl.class);
    /**
     * 日志收集服务
     */
    @Resource(name = "logCollectService")
    ILogCollectService logCollectService;

    /**
     * 批量处理日志
     *
     * @param logDTOList 接口日志信息集合
     */
    @Override
    public void handleLogDTO(List<LogDTO> logDTOList) {
        logCollectService.handleLogDTO(logDTOList);
    }

    /**
     * 处理接口监控信息
     *
     * @param apiMonitorDTOList 接口监控指标信息集合
     */
    @Override
    public void handleApiMonitorDTO(List<ApiMonitorDTO> apiMonitorDTOList) {
        logCollectService.handleApiMonitorDTO(apiMonitorDTOList);
    }
}
